#include "TCP_socket.hpp"
#include <cstdlib>

int main(int argc, char* argv[])
{
    if (argc != 3)
    {
        std::cout << "client ip port" << std::endl;
        exit(1);
    }
    TCP_socket client;
    string ip = argv[1];
    uint16_t port = static_cast<uint16_t>(atoi(argv[2]));

    string buf;//发送的数据
    int fd = client.Connect(ip, port);
    while(1)
    {
        std::cout << "please say: ";
        std::cin >> buf; 
        write(fd, buf.c_str(), sizeof(buf));
    }

    return 0;
}
